﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.Infrastructure;
using DLM.Domain.Model;

namespace DLM.Data.EF.CodeFirst.Mapping
{
    public class EmailInvitationMap : EntityTypeConfiguration<EmailInvitation>
    {
        public EmailInvitationMap()
        {
            this.HasKey(t => t.ID);
            this.ToTable("EmailInvitation");
            this.Property(t => t.ID).HasColumnName("ID").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(t => t.AccountName).HasColumnName("AccountName").IsRequired().HasMaxLength(25);
            this.Property(t => t.UserID).HasColumnName("UserID");
            this.Property(t => t.Email).HasColumnName("Email").IsRequired().IsUnicode(false).HasMaxLength(30);
            this.Property(t => t.Content).HasColumnName("Content");
            this.Property(t => t.PartyID).HasColumnName("PartyID");
            this.Property(t => t.PartySubject).HasColumnName("PartySubject").HasMaxLength(30);
            this.Property(t => t.IsSent).HasColumnName("IsSent");
            this.Property(t => t.SendDate).HasColumnName("SendDate");
        }
    }
}
